package site.icesky.springboot.rocketmq.mqconsumer;

import org.apache.rocketmq.client.consumer.MQPushConsumer;
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
import org.apache.rocketmq.common.protocol.heartbeat.MessageModel;
import site.icesky.springboot.rocketmq.mqconsumer.RocketMqConsumer;

/**
 * @ClassName: AbstractRocketMqConsumer <br>
 * @Description: 实现消费者接口 <br>
 * @Package: site.icesky.springboot.rocketmq.config <br>
 * @author: suitianmou <br>
 * @Date: 2020/5/23-19:48 <br>
 * @version: 1.0 <br>
 * @see <br>
 * @since (从产品的哪一个版本此类被添加进来 ( 可选))<br>
 * 修改历史: <br>
 * 修改时间             修改人           版本变更           修改说明<br>
 * -----------------------------------------------------<br>
 * <br>
 */
public abstract class AbstractRocketMqConsumer implements RocketMqConsumer {
    protected String topics;
    protected  String tags;
    protected MessageListenerConcurrently messageListenerConcurrently;
    protected  String consumerTitle;
    protected MQPushConsumer mqPushConsumer;
    protected MessageModel messageModel;
    protected String consumerGroup;

    public void necessary(String topics, String tags, String consumerTitle, MessageModel messageModel, String consumerGroup){
        this.topics = topics;
        this.tags = tags;
        this.consumerTitle = consumerTitle;
        this.messageModel = messageModel;
        this.consumerGroup = consumerGroup;
    }

    @Override
    public abstract void init();

    @Override
    public void registerMessageListener(MessageListenerConcurrently messageListener) {
        //TODO Auto-generated method stub
        this.messageListenerConcurrently = messageListener;
    }

    public String getTopics() {
        return topics;
    }

    public void setTopics(String topics) {
        this.topics = topics;
    }

    public String getTags() {
        return tags;
    }

    public void setTags(String tags) {
        this.tags = tags;
    }

    public MessageListenerConcurrently getMessageListenerConcurrently() {
        return messageListenerConcurrently;
    }

    public void setMessageListenerConcurrently(MessageListenerConcurrently messageListenerConcurrently) {
        this.messageListenerConcurrently = messageListenerConcurrently;
    }

    public String getConsumerTitle() {
        return consumerTitle;
    }

    public void setConsumerTitle(String consumerTitle) {
        this.consumerTitle = consumerTitle;
    }

    public MQPushConsumer getMqPushConsumer() {
        return mqPushConsumer;
    }

    public void setMqPushConsumer(MQPushConsumer mqPushConsumer) {
        this.mqPushConsumer = mqPushConsumer;
    }

    public MessageModel getMessageModel() {
        return messageModel;
    }

    public void setMessageModel(MessageModel messageModel) {
        this.messageModel = messageModel;
    }

    public String getConsumerGroup() {
        return consumerGroup;
    }

    public void setConsumerGroup(String consumerGroup) {
        this.consumerGroup = consumerGroup;
    }
}
